package com.yang.pojo;

import com.yang.entity.Category;

import java.util.List;

public class categoryVO {
    //父亲
    private Integer id;
    private String name;
    private Integer parentid;

    //儿子
    private List<Category> sons;

    //构造方法
    public categoryVO() {

    }

    public categoryVO(Integer id, String name, List<Category> sons) {
        this.id = id;
        this.name = name;
        this.sons = sons;
    }

    public categoryVO(Integer id, String name, Integer parentid, List<Category> sons) {
        this.id = id;
        this.name = name;
        this.parentid = parentid;
        this.sons = sons;
    }

    public categoryVO(Category parent) {
        //赋值
        this.setId(parent.getId());
        this.setName(parent.getName());
        this.setParentid(parent.getParentid());
    }

    public categoryVO(Category parent,List<Category> sons) {
        this.sons = sons;
        this.setId(parent.getId());
        this.setName(parent.getName());
        this.setParentid(parent.getParentid());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getParentid() {
        return parentid;
    }

    public void setParentid(Integer parentid) {
        this.parentid = parentid;
    }

    public List<Category> getSons() {
        return sons;
    }

    public void setSons(List<Category> sons) {
        this.sons = sons;
    }
}
